"""_summary_
__repr__：返回一个“官方”的字符串表示，通常用于调试和开发。
__str__：返回一个“非正式”的字符串表示，通常用于向用户显示。
    Returns:
        _type_: _description_
"""
class Person:
    def __init__(self, first_name, last_name, age):
        self.first_name = first_name
        self.last_name = last_name
        self.age = age
        
class Man:
    def __init__(self, first_name, last_name, age):
        self.first_name = first_name
        self.last_name = last_name
        self.age = age
    def __repr__(self):
        return f"Man('{self.first_name}', '{self.last_name}', {self.age})"
    
    def __str__(self):
        return f'({self.first_name},{self.last_name},{self.age})'
    
p1 = Person("John", "Doe", 30)
print(f"p1.__repr__()={p1.__repr__()}") # <__main__.Person object at 0x000002D8C7DAFC10>

man1 = Man("John", "Doe", 30)
print(f"man1.__repr__()={man1.__repr__()}") # Man('John', 'Doe', 30)
print(f"str(man1)={str(man1)}") # Man('John', 'Doe', 30)
print(man1.__str__) 

